We study the structural and electronic properties of Mg3Bi2 in both hexagonal and body center cubic (bcc) phases by using first-principles calculations based on the density functional theory (DFT). We solve the Kohn-Sham equations using the full potential linearized augmented plane wave (FP-LAPW) method. The generalized gradient approximations as proposed by Perdew-Burke-Ernzerhof (PBE sol GGA) and Engel-Vosko (EV-GGA) are employed to calculate the exchange correlation potential. Using GGA, we compute the optimized lattice parameters of the bcc. This is the first instance of such application of GGA. In close agreement with experimental results, our electronic calculations show that the hexagonal phase is a direct gap semiconductor with energy gap of 0.2520 eV. The bcc phase calculated band structure shows a direct gap semiconductor with band gap of 1.0306 eV. We further study the effects of applying pressure on the band structure of the system.